Page({
  data: {
    userId: null,
    username: null
  },
  onLoad() {

  },
  onShow(){
    this.getUserInfo()
  },
  publishExpress(){
    dd.navigateTo({
      url: "/pages/my/publishExpress/publishExpress?userId=" + this.data.userId
    })
  },
  getUserInfo() {
    let self = this
    dd.getStorage({
      key: 'userInfo',
      success: function(res) {
        console.log('获取成功：' + res.data.userId);
        self.setData({
          userId: res.data.userId,
          username: res.data.userName
        })
      },
      fail: function(res){
        dd.alert({content: res.errorMessage});
      }
    });
  }
});
